<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2017/6/14
 * Time: 10:54
 */

namespace Weixin\Component\Weixin;


use Common\Common\Component;
use Weixin\Model\Weixin\WeixinModel;

class WeixinComponent extends Component
{
    private $model;

    public function __construct()
    {
        $this->model = new WeixinModel();
    }

    public function isWeixinExist($openid)
    {
        return $this->model->isWeixinExist($openid);
    }

    public function findWeixin($openid)
    {
        return $this->model->findWeixin($openid);
    }

    public function addWeixin($data)
    {
        return $this->model->addWeixin($data);
    }

    public function updateWeixin($openid, $nickname, $update_time, $headimgurl, $subscribe)
    {
        return $this->model->updateWeixin($openid, $nickname, $update_time, $headimgurl, $subscribe);
    }

    /*public function updateSubscribe($openid, $subscribe)
    {
        return $this->model->updateSubscribe($openid, $subscribe);
    }*/

    public function subscribe($openid)
    {
        return $this->model->subscribe($openid);
    }

    public function unsubscribe($openid)
    {
        return $this->model->unsubscribe($openid);
    }
}